package com.huanke.iot.base.dao.device.typeModel;

import com.huanke.iot.base.dao.BaseMapper;
import com.huanke.iot.base.dto.DeviceModelTeamDto;
import com.huanke.iot.base.dto.DeviceParamsDto;
import com.huanke.iot.base.po.device.ability.DeviceAbilityPo;
import com.huanke.iot.base.po.device.typeModel.DeviceModelAbilityPo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author Caik
 * @date 2018/8/16 15:21
 */
public interface DeviceModelAbilityMapper extends BaseMapper<DeviceModelAbilityPo> {
//    DeviceTypePo selectById(DeviceTypePo deviceTypePo);

    List<DeviceModelAbilityPo> selectByModelId(Integer modelId);

    void insertBatch(List<DeviceModelAbilityPo> deviceModelAbilityPoList);

    DeviceModelAbilityPo getByJoinId(@Param("modelId") Integer modelId, @Param("abilityId") Integer abilityId);

    List<DeviceModelAbilityPo> selectByDeviceId(@Param("deviceId") Integer deviceId);

    List<DeviceAbilityPo> selectActiveByModelId(@Param("modelId") Integer modelId);

    List<DeviceParamsDto> queryParamsAbility(@Param("modelId")Integer modelId);

    Integer deleteByModelId(@Param("modelId") Integer modelId);
    Integer updateStatusByModelId(DeviceModelAbilityPo deviceModelAbilityPo);


    void flushCache();

    void updatelistShowAbility(@Param("modelId") Integer modelId, @Param("listShowModelAbilityId") Integer listShowModelAbilityId);

    void updatelistUnShowAbilitys(@Param("modelId") Integer modelId, @Param("listShowModelAbilityId") Integer listShowModelAbilityId);

    DeviceModelAbilityPo selectListShowAbilityByModelId(@Param("modelId") Integer modelId);

    List<Map<Object, Object>> selectIsAdminOperation(@Param("modelId") Integer modelId);

    Double selectMultipleByModelIdAndDirValue(@Param("modelId") Integer modelId, @Param("abilityId") Integer abilityId);

    Double selectMultipleByModelIdAndDirValue1(@Param("modelId") Integer modelId, @Param("dirValue") String dirValue);

    DeviceModelAbilityPo selectByModelIdAndAbilityId(@Param("modelId") Integer modelId, @Param("abilityId") String abilityId);

    List<DeviceModelAbilityPo> selectByIsCheck(Integer modelId);

    DeviceModelTeamDto selectIsTeamAbilityByModelIdAndDirValue(@Param("modelId") Integer modelId, @Param("funcId") String funcId);

    String selectDirValueByMapDirValue(@Param("deviceId") Integer deviceId, @Param("mapDirValue") String mapDirValue);
}
